<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>hello</title>
    <!-- 导入vue包 -->
    <script src="./lib/vue2.6.10.js"></script>
</head>
<body>
    <div id="app">
        <p>{{msg}}</p>
        <son :pmsg="msg"></son>
    </div>

    <template id="son">
        <div>
            <h3>子组件</h3>
            <p>{{pmsg}}</p>
        </div>
    </template>

    <script>
        // 创建一个vue实例
        var vm = new Vue({
            el:'#app', // 当前new的这个vue实例要控制的DOM
            data: {     // 所有的数据
                msg: "hello"
            },

            components: {
                son: {
                    template: "#son",
                    props: ['pmsg']
                },
            },

        })

    </script>
</body>
</html>